package com.dalin.platform.loa.action;

import com.dalin.framework.action.StrutsTwoAction;
import com.dalin.platform.loa.service.LoaService;

/*****************************************************************************
 * @content: 保存用户的角色选择                                               *
 * @author : 那建林                                                          *
 * @crtDate: 2009-07-29                                                     *
 ****************************************************************************/
public class UserAddModRolesAction extends StrutsTwoAction {
	private LoaService loaService;
	private String operationMark;
	private Long[] roleIdArray;
	private Long userId;
	
	public String execute() throws Exception {
		try {
			if ("add".equals(operationMark)) {
				loaService.addUserRoles(userId, roleIdArray);
			} else if ("delete".equals(operationMark)) {
				loaService.delUserRoles(userId, roleIdArray);
			}
			setResContent(true, "");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
	
	
	
	
	
	
	/*************************************************************************
	 * 以下是bean属性的set/get方法
	 */
	public LoaService getLoaService() {
		return loaService;
	}
	public void setLoaService(LoaService loaService) {
		this.loaService = loaService;
	}
	public Long getUserId() {
		return userId;
	}
	public void setUserId(Long userId) {
		this.userId = userId;
	}
	public String getOperationMark() {
		return operationMark;
	}
	public void setOperationMark(String operationMark) {
		this.operationMark = operationMark;
	}
	public Long[] getRoleIdArray() {
		return roleIdArray;
	}
	public void setRoleIdArray(Long[] roleIdArray) {
		this.roleIdArray = roleIdArray;
	}
}
